import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {SaleComponent} from "./sale.component";
import {SaleAddCustomerComponent} from "./add-customer/add-customer.component";
import {SaleDetailComponent} from "./sale-detail/sale-detail.component";
import {AddTrialCampusComponent} from "./add-trial-campus/add-trial-campus.component";
import {AddTrialClassComponent} from "./add-trial-class/add-trial-class.component";
import {AddTrialCourseComponent} from "./add-trial-course/add-trial-course.component";
import {SaleIndexComponent} from "@sale/sale-index/sale-index.component";
import {CustomerListComponent} from "@sale/customer-list/customer-list.component";
import {ApplyRegistrationComponent} from "@sale/apply-registration/apply-registration.component";
import {AuthGuardService} from "@shared/service/auth-guard/auth-guard.service";

const routes: Routes = [
  {
    path: '',
    component: SaleComponent,
    canActivateChild: [AuthGuardService],
    children: [
      {
        path: 'custom',
        component: SaleAddCustomerComponent
      },
      {
        path: 'detail/:studentId/:saleUserId',
        component: SaleDetailComponent
      },
      {
        path: 'campus/:studentId/:saleUserId/:courseId',
        component: AddTrialCampusComponent
      },
      {
        path: 'class/:studentId/:saleUserId/:courseId/:schoolId',
        component: AddTrialClassComponent
      },
      {
        path: 'course/:studentId/:saleUserId',
        component: AddTrialCourseComponent
      },
      {
        path: 'index',
        component: SaleIndexComponent
      },
      {
        path: 'customer-list',
        component: CustomerListComponent
      },
      {
        path: 'apply-registration/:studentId/:saleUserId',
        component: ApplyRegistrationComponent
      },
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class SaleRoutingModule {
}
